From: kaf24@scramble.cl.cam.ac.uk Date: Mon, 6 Oct 2003 09:43:35 +0000 (+0000) Subject: bitkeeper revision 1.479 (3f813947vLCvbxYLugd4rI8gd1R05Q) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~18648 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=302f83aab83caf3455c8a2d7b1bd30847dd24c16;p=xen.git bitkeeper revision 1.479 (3f813947vLCvbxYLugd4rI8gd1R05Q) sched.h, softirq.c, schedule.c, event.c, domain.c, process.c: Cleanups to new scheduler world. --- diff --git a/xen/arch/i386/process.c b/xen/arch/i386/process.c index ec381167ff..d7bc386adc 100644 --- a/xen/arch/i386/process.c +++ b/xen/arch/i386/process.c @@ -76,7 +76,7 @@ void startup_cpu_idle_loop(void) /* Just some sanity to ensure that the scheduler is set up okay. */ ASSERT(current->domain == IDLE_DOMAIN_ID); (void)wake_up(current); - schedule(); + __enter_scheduler(); /* * Declares CPU setup done to the boot processor. diff --git a/xen/common/domain.c b/xen/common/domain.c index 029ed12e57..105c1880a9 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -151,7 +151,7 @@ void __kill_domain(struct task_struct *p) if ( p == current ) { - schedule(); + __enter_scheduler(); BUG(); /* never get here */ } else @@ -196,9 +196,9 @@ long kill_other_domain(unsigned int dom, int force) void stop_domain(void) { - current -> state = TASK_SUSPENDED; - clear_bit(_HYP_EVENT_STOP, &(current->hyp_events)); - schedule (); + set_current_state(TASK_SUSPENDED); + clear_bit(_HYP_EVENT_STOP, ¤t->hyp_events); + __enter_scheduler(); } long stop_other_domain(unsigned int dom) diff --git a/xen/common/event.c b/xen/common/event.c index d0c538d0d3..52627b4391 100644 --- a/xen/common/event.c +++ b/xen/common/event.c @@ -13,12 +13,10 @@ typedef void (*hyp_event_callback_fn_t)(void); -extern void schedule(void); - /* Ordering must match definitions of _HYP_EVENT_* in xeno/sched.h */ static hyp_event_callback_fn_t event_call_fn[] = { - schedule, + __enter_scheduler, kill_domain, stop_domain }; diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 12a41111bb..ddc5d094a3 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -201,7 +201,7 @@ long do_yield(void) { current->state = TASK_INTERRUPTIBLE; current->warpback = 0; /* XXX should only do this when blocking */ - schedule(); + __enter_scheduler(); return 0; } @@ -293,7 +293,7 @@ void reschedule(struct task_struct *p) * i.e., the domain with lowest EVT. * The runqueue should be ordered by EVT so that is easy. ****************************************************************************/ -asmlinkage void schedule(void) +asmlinkage void __enter_scheduler(void) { struct task_struct *prev, *next, *next_prime, *p; struct list_head *tmp; diff --git a/xen/common/softirq.c b/xen/common/softirq.c index b828af6a73..951fb91395 100644 --- a/xen/common/softirq.c +++ b/xen/common/softirq.c @@ -225,14 +225,9 @@ void tasklet_kill(struct tasklet_struct *t) { if (in_interrupt()) printk("Attempt to kill tasklet from interrupt\n"); - - while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { - set_current_state(TASK_RUNNING); - do { - current->policy |= SCHED_YIELD; - schedule(); - } while (test_bit(TASKLET_STATE_SCHED, &t->state)); - } + while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) + while (test_bit(TASKLET_STATE_SCHED, &t->state)) + do_softirq(); tasklet_unlock_wait(t); clear_bit(TASKLET_STATE_SCHED, &t->state); } diff --git a/xen/include/xeno/sched.h b/xen/include/xeno/sched.h index e272e2f890..3c191f13b3 100644 --- a/xen/include/xeno/sched.h +++ b/xen/include/xeno/sched.h @@ -276,7 +276,10 @@ void init_idle_task(void); int wake_up(struct task_struct *p); long do_yield(void); void reschedule(struct task_struct *p); -asmlinkage void schedule(void); + +/* NB. Limited entry in Xen. Not for arbitrary use! */ +asmlinkage void __enter_scheduler(void); +#define schedule() __schedule_not_callable_in_xen() /* A compatibility hack for Linux drivers. */ #define MAX_SCHEDULE_TIMEOUT 0UL